//
//  C_SongerCollectionViewCell.m
//  音悦咖
//
//  Created by Best on 15/7/15.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "C_SongerCollectionViewCell.h"

@implementation C_SongerCollectionViewCell

- (void)dealloc
{
    [_buttonLabel release];
    [_model release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self create];
    }
    return self;
}

- (void)create
{
    self.buttonLabel = [[UILabel alloc] init];
    [self addSubview:self.buttonLabel];
    //self.buttonLabel.backgroundColor = [UIColor blueColor];
    self.buttonLabel.font = [UIFont systemFontOfSize:15];
    [self.buttonLabel setTextAlignment:(NSTextAlignmentCenter)];
    self.buttonLabel.textColor = [UIColor whiteColor];
    [_buttonLabel release];
    UIView *view = [[UIView alloc] init];
    self.selectedBackgroundView = view;
    self.selectedBackgroundView.layer.cornerRadius = 5;
    self.selectedBackgroundView.clipsToBounds = YES;
    self.selectedBackgroundView.backgroundColor = COLOR_STOCHASTIC;
    [view release];
}


- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    self.buttonLabel.frame = layoutAttributes.bounds;
}


- (void)setModel:(SongerModel *)model
{
    if (_model != model) {
        [_model release];
        _model = [model retain];
    }
    
    [self.buttonLabel setText:model.title];
    
}






@end
